/*
Date:20210502 19:22PM
key:第二次做反转链表了，注意两次返回的都是head才对
 */
class Solution {
public:
ListNode* re(ListNode* head,ListNode* &new_head) 
{
    if(head->next!=nullptr)
    {
        ListNode* p=re(head->next,new_head);
        
        p->next=head;
        head->next=nullptr;
        return head;
    }
    else
    {
        new_head=head;
        return head;
    }
}
    ListNode* reverseList(ListNode* head) 
    {
        if(head==nullptr){return nullptr;}
        ListNode* new_head;
        re(head,new_head);
        return new_head;
    }
};